<template>
<view>
<block v-if="_navbar">
    <view class="carGoods" style="position:fixed;bottom:20%;width: 100%;background: #f9f9f9;z-index:3333;" v-if="goodsModel">
        <view class="carHeader">
            <view class="yixuan">已选商品</view>
            <view @tap="clearCar" class="clearAll">
                <image :src="__wxapp_img.store.clear.url" style="width:22rpx; height:22rpx;margin-right:10rpx; "></image>
                <text style="font-size:27rpx;color:#BDBDBD;">清空</text>
            </view>
        </view>
        <view class="hr"></view>
        <scroll-view scroll-y="true" style="max-height: 500rpx;width:100%">
            <block v-for="(cargood, index) in carGoods" :key="index">
                <block v-if="cargood.attr==''">
                    <view class="carGood" v-if="cargood.num>0">
                        <view class="goodsname" style="overflow: hidden; white-space: nowrap; text-overflow: ellipsis;">{{cargood.goods_name}}</view>
                        <view class="goodsNumPrice">
                            <view class="goodsTotalPrice" style="overflow: hidden; white-space: nowrap; text-overflow: ellipsis;">￥{{cargood.goods_price}}</view>
                            <view class="goodsNum">
                                <view @tap="tianjia" class="carStandard" :data-id="cargood.goods_id" :data-index="index" :data-price="cargood.price">
                                    <image class="carStandard" :src="__wxapp_img.store.jia.url"></image>
                                </view>
                                <view class="carStandard" id="carStandard_num">{{cargood.num}}</view>
                                <view @tap="jianshao" class="carStandard" :data-id="cargood.goods_id" :data-index="index" :data-price="cargood.price">
                                    <image class="carStandard" :src="__wxapp_img.store.jian.url"></image>
                                </view>
                            </view>
                        </view>
                    </view>
                </block>
                <block v-else>
                    <view class="carGood" v-if="cargood.num>0">
                        <view class="goods_attr_name">
                            <view class="cargood_name" style="overflow: hidden; white-space: nowrap; text-overflow: ellipsis;">{{cargood.goods_name}}</view>
                            <view class="cargood_attr_name" style="overflow: hidden; white-space: nowrap; text-overflow: ellipsis;float:left;">
                                <text v-for="(item, index2) in cargood.attr" :key="index2">{{item.attr_group_name}}:{{item.attr_name}}</text>
                            </view>
                        </view>
                        <view class="goodsNumPrice">
                            <view class="goodsTotalPrice">￥{{cargood.goods_price}}</view>
                            <view class="goodsNum">
                                <view @tap="tianjia" class="carStandard" :data-id="cargood.goods_id" :data-index="index" :data-price="cargood.price">
                                    <image class="carStandard" :src="__wxapp_img.store.jia.url"></image>
                                </view>
                                <view class="carStandard" id="carStandard_num">{{cargood.num}}</view>
                                <view @tap="jianshao" class="carStandard" :data-id="cargood.goods_id" :data-index="index" :data-price="cargood.price">
                                    <image class="carStandard" :src="__wxapp_img.store.jian.url"></image>
                                </view>
                            </view>
                        </view>
                    </view>
                </block>
            </block>
        </scroll-view>
    </view>
</block>
<block v-else>
    <view class="carGoods" style="position:fixed;bottom:10%;width: 100%;background: #f9f9f9;z-index:4000;" v-if="goodsModel">
        <view class="carHeader">
            <view class="yixuan">已选商品</view>
            <view @tap="clearCar" class="clearAll">
                <image :src="__wxapp_img.store.clear.url" style="width:22rpx; height:22rpx;margin-right:10rpx; "></image>
                <text style="font-size:27rpx;color:#BDBDBD;">清空</text>
            </view>
        </view>
        <view class="hr"></view>
        <scroll-view scroll-y="true" style="max-height: 500rpx;width:100%">
            <block v-for="(cargood, index) in carGoods" :key="index">
                <block v-if="cargood.attr==''">
                    <view class="carGood" v-if="cargood.num>0">
                        <view class="goodsname" style="overflow: hidden; white-space: nowrap; text-overflow: ellipsis;">{{cargood.goods_name}}</view>
                        <view class="goodsNumPrice">
                            <view class="goodsTotalPrice" style="overflow: hidden; white-space: nowrap; text-overflow: ellipsis;">￥</view>
                            <view class="goodsNum">
                                <view @tap="jia" class="carStandard" :data-id="cargood.goods_id" :data-index="index" :data-price="cargood.price">
                                    <image class="carStandard" :src="__wxapp_img.store.jia.url"></image>
                                </view>
                                <view class="carStandard" id="carStandard_num">{{cargood.num}}</view>
                                <view @tap="jian" class="carStandard" :data-id="cargood.goods_id" :data-index="index" :data-price="cargood.price">
                                    <image class="carStandard" :src="__wxapp_img.store.jian.url"></image>
                                </view>
                            </view>
                        </view>
                    </view>
                </block>
                <block v-else>
                    <view class="carGood" v-if="cargood.num>0">
                        <view class="goods_attr_name">
                            <view class="cargood_name" style="overflow: hidden; white-space: nowrap; text-overflow: ellipsis;">{{cargood.goods_name}}</view>
                            <view class="cargood_attr_name" style="overflow: hidden; white-space: nowrap; text-overflow: ellipsis;float:left;">
                                <text v-for="(item, index2) in cargood.attr" :key="index2">{{item.attr_group_name}}:{{item.attr_name}}</text>
                            </view>
                        </view>
                        <view class="goodsNumPrice">
                            <view class="goodsTotalPrice">￥{{cargood.goods_price}}</view>
                            <view class="goodsNum">
                                <view @tap="tianjia" class="carStandard" :data-id="cargood.goods_id" :data-index="index" :data-price="cargood.price">
                                    <image class="carStandard" :src="__wxapp_img.store.jia.url"></image>
                                </view>
                                <view class="carStandard" id="carStandard_num">{{cargood.num}}</view>
                                <view @tap="jianshao" class="carStandard" :data-id="cargood.goods_id" :data-index="index" :data-price="cargood.price">
                                    <image class="carStandard" :src="__wxapp_img.store.jian.url"></image>
                                </view>
                            </view>
                        </view>
                    </view>
                </block>
            </block>
        </scroll-view>
    </view>
</block>
<view @tap="hideGoodsModel" catchtouchmove="preventTouchMove" class="modal-mask" v-if="goodsModel"></view>
</view>
</template>

<style>
@import "./goods_car_list.css";
</style>